package com.dykj.fireFighting.server.base.dev.mapper;

import com.dykj.fireFighting.api.base.bigdata.device.vo.DevHisVo;
import com.dykj.fireFighting.api.base.dev.entity.DevHis;
import com.dykj.fireFighting.api.base.dev.entity.vo.FaultVo;
import com.dykj.fireFighting.api.base.dev.entity.vo.FireVo;
import com.dykj.fireFighting.api.base.dev.vo.RateVo;
import com.dykj.fireFighting.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description 火灾自动报警设备运行记录
 * @Author LJJ
 * @Date 2021-06-30 14:45:09
 */
public interface DevHisMapper extends SuperMapper<DevHis> {

    int getFireNum(@Param("id") String id);

    int getCurrentFireNum(@Param("id") String id);

    int getUpFireNum(@Param("id") String s);

    int getCenterFireNum(@Param("ids") List<String> ids,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    int getCenterCurrentFire(@Param("ids") List<String> ids);

    int getCenterUpFire(@Param("ids") List<String> ids);

    /**
     * 报警趋势统计
     *
     * @param params
     * @return
     */
    List<DevHisVo> queryPoliceStatistical(Map<String, Object> params);

    /**
     * 高发时段统计
     *
     * @param params
     * @return
     */
    List<DevHisVo> queryRateStatistical(Map<String, Object> params);

    int getFireByTime(@Param("id") String s,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    int getAlreadyReviewCount(HashMap<String, Object> params);

    int getEffectCount(HashMap<String, Object> params);

    int getCenterFaultNum(@Param("ids") List<String> ids,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<FireVo> getViewedFireList(@Param("ids") List<String> ids,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<RateVo> getMonthRate(HashMap<String, Object> params);

    List<FaultVo> getFaultList(@Param("ids") List<String> ids,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    int countFaultByTime(@Param("id") String id, @Param("beginTime") String beginTime,@Param("endTime") String endTime,@Param("tableName") String tableName);

    int getUnitNum(@Param("id") String unitId,@Param("beginTime") String beginDate,@Param("endTime") String endDate,@Param("tableName") String tableName);

    List<FireVo> getNewList(@Param("tableName") String tableName,@Param("id") String s,@Param("read") Integer read);
}
